import Vue from 'vue'
import App from './App.vue'
import router from './router'
import './plugins/element.js'
import './assets/fonts/iconfont.css'
import './assets/css/base.css'
import './assets/css/global.css'
import axios from 'axios'
import { message } from './utils/resetMessage'

Vue.prototype.$http = axios
Vue.prototype.$message = message

//配置请求的根路径
axios.defaults.baseURL = 'http://124.221.41.252:8080'
axios.defaults.withCredentials = false;
axios.interceptors.request.use((config) => {
  if (['/user/login'].indexOf(config.url) === -1) {
    const token = sessionStorage.getItem('SMTP_TOKEN')
    if (token) {
      config.headers.SMTP_TOKEN = token
    }
  }
  return config
})


Vue.config.productionTip = false
new Vue({
  router,
  render: h => h(App)
}).$mount('#app')
